package model;

import service.LoginService;
import javaBean.Login;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

import static model.URL.BASE_URL;

/**
 * Created by acer on 2017/9/26.
 */

public class LoginModel {

    private Retrofit retrofit;

    public LoginModel(String url) {
        retrofit = new Retrofit.Builder()
                .baseUrl(BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    public retrofit2.Call<Login> login(String str_tel, String str_password) {
        LoginService service = retrofit.create(LoginService.class);

        return service.Login(str_tel, str_password);
    }
}